SRC := $(wildcard *.c)
ELF := $(patsubst %.c, %.elf, $(SRC))
ELF := $(filter-out caminfo.elf, $(ELF))


CPPFLAGS += -I inc/

LDFLAGS  += -L lib/
LDFLAGS  += -ljpeg
LDFLAGS  += -lpthread
LDFLAGS  += -Wl,-rpath=.

CROSS = arm-none-linux-gnueabi-
CC = $(CROSS)gcc


all:$(ELF)

$(ELF):%.elf:%.c caminfo.c
	$(CC) -o $@ $^ $(CPPFLAGS) $(LDFLAGS)

clean:
	-@$(RM) $(ELF)
	-@echo "Done."

distclean:clean
	-@$(RM) *.o *.jpg
